package study.alibaba.sentinel.support.exception;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import study.eggs.result.Result;
import study.eggs.result.Results;

@Slf4j
//@RestControllerAdvice
public class GlobalMvcExceptionHandler {

    @ExceptionHandler(Throwable.class)
    public Result resolveException(Exception ex) {
        log.error("全局 Mvc 异常处理器: ", ex);
        //
        return Results.fail();
    }
}
